#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include "QTcpSocket"
#include "QMessageBox"
#include "QHostAddress"
#include "QFileDialog"

QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();
    void socketConnect();
    void dealDataFromServer();
    void showDownloadItem(QString items);
    void copyDatatoLocal(QByteArray data);

private slots:
    void on_pushButtonConnect_clicked();

    void on_pushButtonDowload_clicked();

private:
    Ui::MainWindow *ui;
    QTcpSocket *socket;
    QString filePath;
    QString fileName;
    QFile *file;
    bool isLoad = false;
};
#endif // MAINWINDOW_H
